
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta name="referrer" content="never">
    <meta name="robots" content="noindex, nofollow">

    <link rel="shortcut icon" href="/assets/img/favicon.ico" />
    <!-- Loading Bootstrap -->
    <link href="/assets/css/backend.css?v=1643209926" rel="stylesheet">

    <script src="/huodong/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/huodong/js/index.js"></script>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="/assets/js/html5shiv.js"></script>
    <script src="/assets/js/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var require = {
            config:  {"site":{"name":"\u4e2d\u533b\u9986","cdnurl":"","version":1643209926,
                    "timezone":"Asia\/Shanghai","languages":{"backend":"zh-cn","frontend":"zh-cn"}
                },"upload":{"cdnurl":"","uploadurl":"\/RSKdAsNBVE.php\/ajax\/upload",
                    "bucket":"local",
                    "maxsize":"10mb",
                    "mimetype":"jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx,wav,mp4,mp3,pdf",
                    "chunking":false,
                    "chunksize":2097152,
                    "savekey":"\/uploads\/{year}{mon}{day}\/{filemd5}{.suffix}","multipart":[],
                    "multiple":false,"storage":"local"
                },"modulename":"admin",
                "controllername":"docdepartment.doctor",
                "actionname":"index",
                "jsname":"backend\/docdepartment\/doctor",
                "moduleurl":"\/RSKdAsNBVE.php","language":"zh-cn",
                "referer":null,"__PUBLIC__":"\/","__ROOT__":"\/","__CDN__":""
            }
        };
    </script>

</head>

<body class="inside-header inside-aside ">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <section class="content-header hide">
                        <h1>
                            控制台                                    <small>Control panel</small>
                        </h1>
                    </section>
                    <div class="content">
                        <div class="panel panel-default panel-intro">

                            <div class="panel-body">
                                <div id="myTabContent" class="tab-content">
                                    <div class="tab-pane fade active in" id="one">
                                        <div class="widget-body no-padding">
                                            <div id="toolbar" class="toolbar">
                                                <a href="javascript:;" class="btn btn-primary btn-refresh" title="刷新"  onclick="location.reload()" title="刷新"><i class="fa fa-refresh"></i> </a>
                                                <a href="javascript:;"  onclick="xadmin.open('创建活动','add',1000,700)" class="btn btn-success btn-add " title="添加" ><i class="fa fa-plus"></i> 添加</a>
                                                <a onclick="delAll()" href="javascript:;" class="btn btn-danger btn-del btn-disabled  " title="删除" >
                                                    <i class="fa fa-trash"></i> 批量删除</a>
                                                <!-- <a href="javascript:;" class="btn btn-danger btn-import " title="导入" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> 导入</a> -->

                                                <div class="dropdown btn-group ">
                                                    <!-- <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> 更多</a> -->
                                                    <ul class="dropdown-menu text-left" role="menu">
                                                        <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> 设为正常</a></li>
                                                        <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> 设为隐藏</a></li>
                                                    </ul>
                                                </div>

<!--                                                <a class="btn btn-success btn-recyclebin btn-dialog " href="docdepartment/doctor/recyclebin" title="回收站"><i class="fa fa-recycle"></i> 回收站</a>-->
<!--                                            -->
                                            </div>
                                            <table  class="table table-striped table-bordered table-hover table-nowrap"
                                                   data-operate-edit="1"
                                                   data-operate-del="1"
                                                   width="100%">

                                                <thead>
                                                <tr>
                                                    <th>
                                                        <input type="checkbox" name=""  lay-skin="primary">
                                                    </th>
                                                    <th>ID</th>
                                                    <th>活动主题</th>
                                                    <th>开始时间</th>
                                                    <th>结束时间</th>
                                                    <th>活动地址</th>
                                                    <th>加入时间</th>
                                                    <th>操作</th>
                                                </thead>
                                                <tbody>
                                                {foreach $res as $val}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" name="id" value="{$val['id']}"  lay-skin="primary">
                                                    </td>
                                                    <td>{$val['id']}</td>
                                                    <td>{$val['title']}</td>
                                                    <td>{$val['start_time']}</td>
                                                    <td>{$val['end_time']}</td>
                                                    <td>{$val['addr']}</td>
                                                    <td>{$val['add_time'] | date='Y-m-d H:i:s',###}</td>
                                                    <!--                            <td class="td-status">-->
                                                    <!--                                <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span>-->
                                                    <!--                            </td>-->
                                                    <td class="td-manage">
<!--                                                        <a onclick="xadmin.open('报名成员列表','user_list?id={$val['id']}')" href="javascript:;"  title="报名成员列表">-->
<!--                                                            <i class="layui-icon">&#xe601;</i>-->
<!--                                                        </a>-->
<!--                                                        <a title="编辑"  onclick="xadmin.open('编辑','upd?id={$val['id']}')" href="javascript:;">-->
<!--                                                            <i class="layui-icon">&#xe642;</i>-->
<!--                                                        </a>-->
<!--                                                        <a title="删除"  href="javascript:;">-->
<!--                                                            <i class="layui-icon">&#xe640;</i>-->
<!--                                                        </a>-->

                                                        <a onclick="xadmin.open('报名成员列表','user_list?id={$val['id']}')" href="javascript:;" style="background: #3a87ad" class="btn btn-success btn-edit btn-disabled  " title="编辑" ><i class="fa fa-pencil"></i>
                                                            报名成员列表</a>
                                                        <a onclick="xadmin.open('编辑','upd?id={$val['id']}')" href="javascript:;" class="btn btn-success btn-edit btn-disabled  " title="编辑" ><i class="fa fa-pencil"></i>
                                                            编辑</a>
                                                        <a onclick="member_del(this,'{$val['id']}')" href="javascript:;" class="btn btn-danger btn-del btn-disabled  " title="删除" >
                                                            <i class="fa fa-trash"></i> 删除</a>
                                                    </td>
                                                </tr>
                                                {/foreach}
                                                </tbody>

                                            </table>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/assets/js/require.js" data-main="/assets/js/require-backend.js?v=1643209926"></script>


<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){

            if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

            }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
            }

        });
    }

    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            var ids=[]
            ids.push(id)
            if (ids==[])
            {
                layer.alert('请选择内容',{icon:5})
                return false
            }
            $.ajax({
                url:"/RSKdAsNBVE.php/huodong/delHuodong",
                type:"post",
                data:{
                    ids:ids
                },
                success(res)
                {
                    console.log(res)
                }
            })
            //发异步删除数据
            // $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
            setTimeout(function (){
                window.location.href=''
            },800)
        });
    }



    function delAll (argument) {

        var ids = [];

        // 获取选中的id
        $('tbody input').each(function(index, el) {
            if($(this).prop('checked')){
                ids.push($(this).val())
            }
        });

        layer.confirm('确认要删除吗？'+ids.toString(),{icon:3,title:'提示信息'},function(index){
            if (ids==[])
            {
                layer.alert('请选择内容',{icon:5})
                return false
            }
            $.ajax({
                url:"/RSKdAsNBVE.php/huodong/delHuodong",
                type:"post",
                data:{
                    ids:ids
                },
                success(res)
                {
                    console.log(res)

                    //捉到所有被选中的，发异步进行删除
                    layer.msg('删除成功', {icon: 1});
                    setTimeout(function (){
                        window.location.href=''
                    },800)
                    // $(".layui-form-checked").not('.header').parents('tr').remove();

                }
            })

        });



    }
</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>
</html>
